<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html>
<head>
    <title>专家抽取规则日志</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="${ctx}/lib/js/html5shiv.min.js"></script>
        <script src="${ctx}/lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
							
    <section class="content-header">
        <h1>专家抽取规则维护记录</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">专家抽取管理</a></li>
            <li class="active"><a href="#">抽取规则设置</a></li>
             
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class="form-inline">
					<div class="form-group form-group-xs">
                        <label for="updDatetime">更新时间：</label>
                        <input class="form-control" type="text" name="startPoint" id="startPoint" placeholder="开始时间" data-provide="datepicker" data-date-fmt="yyyy-MM-dd  HH:mm:ss"/>
                        <label>-</label>
                        <input class="form-control" type="text" name="endPoint" id="endPoint" placeholder="结束时间" data-provide="datepicker" data-date-fmt="yyyy-MM-dd  HH:mm:ss" />
                    </div>
                    <button type="button" class="btn btn-success btn-sm" onclick="search();">查&nbsp;询</button>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
        <div class=" box box-warning bottongroup">
             <a href="toExpertExtractRuleList.html?projId=${projId }" class="btn btn-default btn-sm" onclick="back()">返&nbsp;回</a>
        </div>
    </section>
    
      <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    
    <script type="text/javascript">
		 function getExperType(preId){//获取专家类别
		    $("#"+preId+"1").HNSelect({
		        url: "${pageContext.request.contextPath}/selectController/getExpertType.html", data: { ID: '0' },  defaultText: "<option value=''>请选择</option>",
		        func: function () {
		            $("#"+preId+"2").HNSelect({
		                parent_selector: "#"+preId+"1", url: "${pageContext.request.contextPath}/selectController/getExpertType.html", dataid: "ID",defaultText: "<option value=''>请选择</option>",
		                		  func: function () {
		                              $("#"+preId+"3").HNSelect({
		                                  parent_selector: "#"+preId+"2", url: "${pageContext.request.contextPath}/selectController/getExpertType.html", dataid: "ID", defaultText: "<option value=''>请选择</option>"
		                              });
		                          }
		           		 });
		       		 }
		    	});
		  }
         function back(){
         	window.location.href="toExpertExtractRuleList.html";
         }
    	function search(page) {
    		var startPoint = $.trim($("#startPoint").val());
    		var endPoint = $.trim($("#endPoint").val());
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{"startPoint":startPoint, "endPoint":endPoint},
    	        page : (page || 1)
    	    }).trigger("reloadGrid"); //重新载入  
    	}
    
        $(function () {
        	$("#gridlist").jqGrid({
                url: "${ctx}/expertExtractRule/getExtractRuleLogList.html",
                mtype: "post",
                postData:{projId:"${projId}",ruleId:"${ruleId}"},
                datatype: "json",
                autowidth: true,
                shrinkToFit:true,
                height: 270,
                colNames: [
                    '操作',
                    'logId',
                    'ruleCode',
                    '是否大输液',
                    '规则id',
					'所属项目id', 
					'所属项目', 
					'专家类别id', 
					'专家类别编码',
					'专家类别',
					'数量', 
					'抽取状态',
					'抽取时间',
					'抽取组数',
					'状态', 
					'更新时间',
					'更新人'
					
					
                ],
                colModel: [
                   { name: 'operate', width: 60, align:"center", sortable: false,
	                    formatter : function(val, opts, rowdata) {
                         	var str = "<a href='toExpertExtractRuleLogDetail.html?updDateTime="+rowdata.updDatetime+"&ruleId=" + rowdata.ruleId + "&logId="+rowdata.logId+"'>详情</a>";
    	                    return str;
                    }},
                    { name: 'logId',hidden:true, width: 100, align:"center", sortable: false},
                    { name: 'ruleCode',hidden:true, width: 100, align:"center", sortable: false},
                    { name: 'infusion', width: 80,align:"center", sortable: false,
                    	formatter:function(val,opts,rowdata){
                    		if(rowdata.infusion==1){
                    			return "是";
                    		}else if(rowdata.infusion==0){
                    			return "否";
                    		}else {
                    			return "";
                    		}
                    	}
                    },
                    { name: 'ruleId',hidden:true, width: 100, align:"center", sortable: false},
                    { name: 'projId',hidden:true,  width: 120, align:"center", sortable: false},
                    { name: 'name', hidden:true,width: 160, align:"center", sortable: false},
                    { name: 'expertTypeId',hidden:true, width: 100, align:"left", sortable: false},
                    { name: 'expertTypeCode',hidden:true, width: 80, align:"left", sortable: false},
                    { name: 'expertTypeName',hidden:true, width: 90, align:"center", sortable: false},
                    { name: 'count', width: 60,hidden:true, align:"center", sortable: false,
                    	formatter : function(val, opts, rowdata) {
                    		if(rowdata.exec_status==1){
                    			str = "<a href='toExtractExpertList.html?ruleId=" + rowdata.ruleId + "'>"+rowdata.count+"</a>";
                    		}else{
                    			str = rowdata.count;
                    		}
	               		   return str;
                    	}
                    },
                    
                    { name: 'execStatus', width: 60, align: 'center', sortable: false,
                    	formatter : function(val, opts, rowdata) {
                    		var strSta = "";
                    		if(rowdata.execStatus == 1){
                    			strSta += "已抽取";
                    		}else if(rowdata.execStatus == 0){
                    			strSta += "未抽取";
                    		}
                    		return strSta;
                    	}
                    },
                    { name: 'execDatetime', width: 110, align:"center", sortable: false},
                    { name: 'extractNum', width: 110, align:"center", sortable: false},
                    { name: 'status', width: 60, align: 'center', sortable: false,
                    	formatter : function(val, opts, rowdata) {
                    		var strSta = "";
                    		if(rowdata.status == 1){
                    			strSta += "启用";
                    		}else if(rowdata.status == 0){
                    			strSta += "停用";
                    		}
                    		return strSta;
                    	}
                    },
                    { name: 'updDatetime', width: 110, align:"center", sortable: false},
                    { name: 'updUser',width: 110, align:"center", sortable: false}
                   
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                //multiselect: true, 
                viewrecords: true,
                caption: "抽取规则维护记录列表",
                jsonReader: {
                    id: "ruleId"
                }
            });
            getExperType("expertType");
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
            
        });
    </script>
</body>
</html>












